<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>MySQLi_STMT类</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="mysqli.warning-count.html">« mysqli::$warning_count</a></li>
      <li style="float: right;"><a href="mysqli-stmt.affected-rows.html">mysqli_stmt::$affected_rows »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.mysqli.html">Mysqli</a></li>
    <li>MySQLi_STMT类</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.mysqli-stmt" class="reference">
 <h1 class="title">MySQLi_STMT类</h1>
 
 
 <div class="partintro"><p class="verinfo">(PHP 5, PHP 7, PHP 8)</p>
 

  <div class="section" id="mysqli-stmt.intro">
   <h2 class="title">简介</h2>
   <p class="para">
   代表一个预编译 SQL 语句。
   </p>
  </div>

 
  <div class="section" id="mysqli-stmt.synopsis">
   <h2 class="title">类摘要</h2>
 

   <div class="classsynopsis">
    <div class="ooclass"></div>
 

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">mysqli_stmt</strong>
     </span>
     {</div>

 
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 属性 */</div>
    <div class="fieldsynopsis"><span class="type"><span class="type">int</span>|<span class="type">string</span></span> <var class="varname"><a href="mysqli-stmt.affected-rows.html">$<var class="varname">affected_rows</var></a></var>;</div>
<div class="fieldsynopsis"><span class="type">int</span> <var class="varname"><a href="mysqli-stmt.errno.html">$<var class="varname">errno</var></a></var>;</div>
<div class="fieldsynopsis"><span class="type">array</span> <var class="varname"><a href="mysqli-stmt.error-list.html">$<var class="varname">error_list</var></a></var>;</div>
<div class="fieldsynopsis"><span class="type">string</span> <var class="varname"><a href="mysqli-stmt.error.html">$<var class="varname">error</var></a></var>;</div>
<div class="fieldsynopsis"><span class="type">int</span> <var class="varname"><a href="mysqli-stmt.field-count.html">$<var class="varname">field_count</var></a></var>;</div>
<div class="fieldsynopsis"><span class="type"><span class="type">int</span>|<span class="type">string</span></span> <var class="varname"><a href="mysqli-stmt.insert-id.html">$<var class="varname">insert_id</var></a></var>;</div>
<div class="fieldsynopsis"><span class="type"><span class="type">int</span>|<span class="type">string</span></span> <var class="varname"><a href="mysqli-stmt.num-rows.html">$<var class="varname">num_rows</var></a></var>;</div>
<div class="fieldsynopsis"><span class="type">int</span> <var class="varname"><a href="mysqli-stmt.param-count.html">$<var class="varname">param_count</var></a></var>;</div>
<div class="fieldsynopsis"><span class="type">string</span> <var class="varname"><a href="mysqli-stmt.sqlstate.html">$<var class="varname">sqlstate</var></a></var>;</div>

 
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mysqli_stmt_affected_rows</strong></span>(<span class="methodparam"><span class="type"><a href="class.mysqli-stmt.html" class="type mysqli_stmt">mysqli_stmt</a></span> <code class="parameter">$statement</code></span>): <span class="type"><span class="type">int</span>|<span class="type">string</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.attr-get.html" class="methodname">attr_get</a></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$attribute</code></span>): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.attr-set.html" class="methodname">attr_set</a></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$attribute</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$value</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.bind-param.html" class="methodname">bind_param</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$types</code></span>, <span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter reference">&$var</code></span>, <span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter reference">&...$vars</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.bind-result.html" class="methodname">bind_result</a></span>(<span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter reference">&$var</code></span>, <span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter reference">&...$vars</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.close.html" class="methodname">close</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.data-seek.html" class="methodname">data_seek</a></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$offset</code></span>): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="methodname"><strong>mysqli_stmt_errno</strong></span>(<span class="methodparam"><span class="type"><a href="class.mysqli-stmt.html" class="type mysqli_stmt">mysqli_stmt</a></span> <code class="parameter">$statement</code></span>): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="methodname"><strong>mysqli_stmt_error_list</strong></span>(<span class="methodparam"><span class="type"><a href="class.mysqli-stmt.html" class="type mysqli_stmt">mysqli_stmt</a></span> <code class="parameter">$statement</code></span>): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="methodname"><strong>mysqli_stmt_error</strong></span>(<span class="methodparam"><span class="type"><a href="class.mysqli-stmt.html" class="type mysqli_stmt">mysqli_stmt</a></span> <code class="parameter">$statement</code></span>): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.execute.html" class="methodname">execute</a></span>(<span class="methodparam"><span class="type">?</span><span class="type"><span class="type">array</span><span class="type"></span></span> <code class="parameter">$params</code><span class="initializer"> = <strong><code>null</code></strong></span></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.fetch.html" class="methodname">fetch</a></span>(): <span class="type"><span class="type">?</span><span class="type">bool</span></span></div>
<div class="methodsynopsis dc-description"><span class="methodname"><strong>mysqli_stmt_field_count</strong></span>(<span class="methodparam"><span class="type"><a href="class.mysqli-stmt.html" class="type mysqli_stmt">mysqli_stmt</a></span> <code class="parameter">$statement</code></span>): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.free-result.html" class="methodname">free_result</a></span>(): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.get-result.html" class="methodname">get_result</a></span>(): <span class="type"><span class="type"><a href="class.mysqli-result.html" class="type mysqli_result">mysqli_result</a></span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.get-warnings.html" class="methodname">get_warnings</a></span>(): <span class="type"><span class="type"><a href="class.mysqli-warning.html" class="type mysqli_warning">mysqli_warning</a></span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="methodname"><strong>mysqli_stmt_insert_id</strong></span>(<span class="methodparam"><span class="type"><a href="class.mysqli-stmt.html" class="type mysqli_stmt">mysqli_stmt</a></span> <code class="parameter">$statement</code></span>): <span class="type"><span class="type">int</span>|<span class="type">string</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.more-results.html" class="methodname">more_results</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.next-result.html" class="methodname">next_result</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.num-rows.html" class="methodname">num_rows</a></span>(): <span class="type"><span class="type">int</span>|<span class="type">string</span></span></div>
<div class="methodsynopsis dc-description"><span class="methodname"><strong>mysqli_stmt_param_count</strong></span>(<span class="methodparam"><span class="type"><a href="class.mysqli-stmt.html" class="type mysqli_stmt">mysqli_stmt</a></span> <code class="parameter">$statement</code></span>): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.prepare.html" class="methodname">prepare</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$query</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.reset.html" class="methodname">reset</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.result-metadata.html" class="methodname">result_metadata</a></span>(): <span class="type"><span class="type"><a href="class.mysqli-result.html" class="type mysqli_result">mysqli_result</a></span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.send-long-data.html" class="methodname">send_long_data</a></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$param_num</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$data</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="methodname"><strong>mysqli_stmt_sqlstate</strong></span>(<span class="methodparam"><span class="type"><a href="class.mysqli-stmt.html" class="type mysqli_stmt">mysqli_stmt</a></span> <code class="parameter">$statement</code></span>): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mysqli-stmt.store-result.html" class="methodname">store_result</a></span>(): <span class="type">bool</span></div>

   }</div>

 
  </div>
 
 </div>
 
 













































































































































<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="mysqli-stmt.affected-rows.html">mysqli_stmt::$affected_rows</a> — Returns the total number of rows changed, deleted, inserted, or
  matched by the last statement executed</li><li><a href="mysqli-stmt.attr-get.html">mysqli_stmt::attr_get</a> — Used to get the current value of a statement attribute</li><li><a href="mysqli-stmt.attr-set.html">mysqli_stmt::attr_set</a> — Used to modify the behavior of a prepared statement</li><li><a href="mysqli-stmt.bind-param.html">mysqli_stmt::bind_param</a> — Binds variables to a prepared statement as parameters</li><li><a href="mysqli-stmt.bind-result.html">mysqli_stmt::bind_result</a> — Binds variables to a prepared statement for result storage</li><li><a href="mysqli-stmt.close.html">mysqli_stmt::close</a> — Closes a prepared statement</li><li><a href="mysqli-stmt.construct.html">mysqli_stmt::__construct</a> — Constructs a new mysqli_stmt object</li><li><a href="mysqli-stmt.data-seek.html">mysqli_stmt::data_seek</a> — Seeks to an arbitrary row in statement result set</li><li><a href="mysqli-stmt.errno.html">mysqli_stmt::$errno</a> — Returns the error code for the most recent statement call</li><li><a href="mysqli-stmt.error-list.html">mysqli_stmt::$error_list</a> — Returns a list of errors from the last statement executed</li><li><a href="mysqli-stmt.error.html">mysqli_stmt::$error</a> — Returns a string description for last statement error</li><li><a href="mysqli-stmt.execute.html">mysqli_stmt::execute</a> — Executes a prepared statement</li><li><a href="mysqli-stmt.fetch.html">mysqli_stmt::fetch</a> — Fetch results from a prepared statement into the bound variables</li><li><a href="mysqli-stmt.field-count.html">mysqli_stmt::$field_count</a> — Returns the number of columns in the given statement</li><li><a href="mysqli-stmt.free-result.html">mysqli_stmt::free_result</a> — Frees stored result memory for the given statement handle</li><li><a href="mysqli-stmt.get-result.html">mysqli_stmt::get_result</a> — Gets a result set from a prepared statement as a mysqli_result object</li><li><a href="mysqli-stmt.get-warnings.html">mysqli_stmt::get_warnings</a> — Get result of SHOW WARNINGS</li><li><a href="mysqli-stmt.insert-id.html">mysqli_stmt::$insert_id</a> — Get the ID generated from the previous INSERT operation</li><li><a href="mysqli-stmt.more-results.html">mysqli_stmt::more_results</a> — Check if there are more query results from a multiple query</li><li><a href="mysqli-stmt.next-result.html">mysqli_stmt::next_result</a> — Reads the next result from a multiple query</li><li><a href="mysqli-stmt.num-rows.html">mysqli_stmt::$num_rows</a> — Returns the number of rows fetched from the server</li><li><a href="mysqli-stmt.param-count.html">mysqli_stmt::$param_count</a> — Returns the number of parameters for the given statement</li><li><a href="mysqli-stmt.prepare.html">mysqli_stmt::prepare</a> — Prepares an SQL statement for execution</li><li><a href="mysqli-stmt.reset.html">mysqli_stmt::reset</a> — Resets a prepared statement</li><li><a href="mysqli-stmt.result-metadata.html">mysqli_stmt::result_metadata</a> — Returns result set metadata from a prepared statement</li><li><a href="mysqli-stmt.send-long-data.html">mysqli_stmt::send_long_data</a> — Send data in blocks</li><li><a href="mysqli-stmt.sqlstate.html">mysqli_stmt::$sqlstate</a> — Returns SQLSTATE error from previous statement operation</li><li><a href="mysqli-stmt.store-result.html">mysqli_stmt::store_result</a> — Stores a result set in an internal buffer</li></ul>
</div>
</div></div></body></html>